package dao

import (
	"context"
	"mall-portalv2/internal/model"
)

func (d *Dao) QueryViewCouponDetail(ctx context.Context, MemberId int64) ([]model.ViewCouponDetail, error) {
	tb := model.ViewCouponDetail{}
	result := []model.ViewCouponDetail{}

	if err := d.db.WithContext(ctx).Table(tb.TableName()).Where("member_id = ?", MemberId).Find(&result).Error; err != nil {
		return result, err
	}
	return result, nil
}
